/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */

/* credenza-bookmark.h - interface for individual bookmarks.

   Copyright (C) 1999, 2000 Eazel, Inc.

   The Gnome Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public License as
   published by the Free Software Foundation; either version 2 of the
   License, or (at your option) any later version.

   The Gnome Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with the Gnome Library; see the file COPYING.LIB.  If not,
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.

   Authors: John Sullivan <sullivan@eazel.com>
*/

#ifndef CREDENZA_BOOKMARK_H
#define CREDENZA_BOOKMARK_H

#include <gtk/gtk.h>
#include <gio/gio.h>
typedef struct CredenzaBookmark CredenzaBookmark;

#define CREDENZA_TYPE_BOOKMARK credenza_bookmark_get_type()
#define CREDENZA_BOOKMARK(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST ((obj), CREDENZA_TYPE_BOOKMARK, CredenzaBookmark))
#define CREDENZA_BOOKMARK_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST ((klass), CREDENZA_TYPE_BOOKMARK, CredenzaBookmarkClass))
#define CREDENZA_IS_BOOKMARK(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CREDENZA_TYPE_BOOKMARK))
#define CREDENZA_IS_BOOKMARK_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE ((klass), CREDENZA_TYPE_BOOKMARK))
#define CREDENZA_BOOKMARK_GET_CLASS(obj) \
  (G_TYPE_INSTANCE_GET_CLASS ((obj), CREDENZA_TYPE_BOOKMARK, CredenzaBookmarkClass))

typedef struct CredenzaBookmarkDetails CredenzaBookmarkDetails;

struct CredenzaBookmark {
	GObject object;
	CredenzaBookmarkDetails *details;	
};

struct CredenzaBookmarkClass {
	GObjectClass parent_class;

	/* Signals that clients can connect to. */

	/* The appearance_changed signal is emitted when the bookmark's
	 * name or icon has changed.
	 */
	void	(* appearance_changed) (CredenzaBookmark *bookmark);

	/* The contents_changed signal is emitted when the bookmark's
	 * URI has changed.
	 */
	void	(* contents_changed) (CredenzaBookmark *bookmark);
};

typedef struct CredenzaBookmarkClass CredenzaBookmarkClass;

GType                 credenza_bookmark_get_type               (void);
CredenzaBookmark *    credenza_bookmark_new                    (GFile *location,
                                                                const char *name,
                                                                gboolean has_custom_name,
                                                                GIcon *icon);
CredenzaBookmark *    credenza_bookmark_copy                   (CredenzaBookmark      *bookmark);
char *                credenza_bookmark_get_name               (CredenzaBookmark      *bookmark);
GFile *               credenza_bookmark_get_location           (CredenzaBookmark      *bookmark);
char *                credenza_bookmark_get_uri                (CredenzaBookmark      *bookmark);
GIcon *               credenza_bookmark_get_icon               (CredenzaBookmark      *bookmark);
gboolean	      credenza_bookmark_get_has_custom_name    (CredenzaBookmark      *bookmark);		
gboolean              credenza_bookmark_set_name               (CredenzaBookmark      *bookmark,
								const char            *new_name);		
gboolean              credenza_bookmark_uri_known_not_to_exist (CredenzaBookmark      *bookmark);
int                   credenza_bookmark_compare_with           (gconstpointer          a,
								gconstpointer          b);
int                   credenza_bookmark_compare_uris           (gconstpointer          a,
								gconstpointer          b);

void                  credenza_bookmark_set_scroll_pos         (CredenzaBookmark      *bookmark,
								const char            *uri);
char *                credenza_bookmark_get_scroll_pos         (CredenzaBookmark      *bookmark);


/* Helper functions for displaying bookmarks */
GdkPixbuf *           credenza_bookmark_get_pixbuf             (CredenzaBookmark      *bookmark,
								GtkIconSize            icon_size);
GtkWidget *           credenza_bookmark_menu_item_new          (CredenzaBookmark      *bookmark);

#endif /* CREDENZA_BOOKMARK_H */
